/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package util;

import java.io.File;

/**
 *
 * @author Marcin
 */
public class FilesUtil {
    public File createDir(String dirname){
        File dir = new File(defaultDirectory() + "\\Przychodnia");
        if(!dir.exists()) {
            dir.mkdir();
        }
        File dirLog = new File(dir.getPath() + "\\" + dirname);
        if(!dirLog.exists()) {
            dirLog.mkdir();
        }
        return dirLog;
    }
    private String defaultDirectory()
    {
        String OS = System.getProperty("os.name").toUpperCase();
        if (OS.contains("WIN"))
            return System.getenv("APPDATA");
        else if (OS.contains("NUX"))
            return System.getProperty("user.home");
        return System.getProperty("user.dir");
    }
}
